package com.wds.sso.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wds.core.entity.base.SystemUser;
import com.wds.sso.mapper.SystemUserMapper;
import com.wds.sso.service.ISystemUserService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户 服务实现类
 * </p>
 *
 * @author dhaigang
 * @since 2024-03-28
 */
@Service("userService")
public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemUser> implements ISystemUserService {

    public SystemUser loadUserByUsername(String username) throws UsernameNotFoundException {
        SystemUser systemUser = this.getOne(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getUsername, username));

        return systemUser;

    }
}
